package org.magento.pages;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;

/*This class presents /index.php/checkout/onepage/success/ page
 * 
 */


public class ShoppingCartSuccess extends Page {


	//Locators:
	@FindBy(xpath = "/descendant::div[@class='col-main']/p/a")
	public WebElement linkOrderNumber;
	
	//Actions:
	
	//Get element ID
	public String getOrderID() {
		String orderID = driver.findElement(By.xpath("/descendant::div[@class='col-main']/p/a")).getText();
		return orderID;
	}
	
	
	//Assertions:
	
	//Verify was product purchased? 
		public boolean isOrderRerformed() {
			return driver.findElement(By.cssSelector("BODY")).getText().contains("Your order has been received.");
		}
	
	//Auto-generated:
	public ShoppingCartSuccess(WebDriver driver) {
		super(driver);
	}

	@Override
	public void open() {	
	}
}
